<?php
namespace app\api\controller;


use app\api\model\Announce as AnnounceModel;
use app\api\model\AnnounceImg as AnnounceImgModel;
use app\api\model\VideoCenter as VideoCenterModel;
use app\lib\exception\DataMissException;

/**
 * 品牌资讯
 */
class Announce
{
	/*
	获取公告信息
	*/
	public function getAnnounce()
	{
		$info = AnnounceModel::getAnnounceInfo();

		if(!$info) {
		    throw new DataMissException([
		    	'msg' => '请求的公告数据不存在'
		    ]);
        }

		return $info;
	}

	/*
	获取公告图片
	*/
	public function getAnnounceImg()
	{
		$img = AnnounceImgModel::getAnnounceImg();

		if(!$img) {
		    throw new DataMissException([
		    	'msg' => '请求的公告图片数据不存在'
		    ]);
        }

		return $img;
	}

	/*
	获取视频
	*/
	public function getVideo()
	{
		$video_info = VideoCenterModel::getVideoInfo();

		if(!$video_info) {
		    throw new DataMissException([
		    	'msg' => '请求的视频数据不存在'
		    ]);
        }

		return $video_info;
	}
}
